<extend name="Public:common" />
<block name="content">
<div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/Admin">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">分类管理</span></div>
        </div>
        <div class="result-wrap">
                <div class="result-title">
                    <div class="result-list">
                        <a href="__URL__/insert"><i class="icon-font"></i>新增</a>
                        <!-- <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a> -->
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th>ID</th>
                            <th>标题</th>
                            <th>操作</th>
                        </tr>

                        <foreach name="Tarr" item="vo">
	                        <tr>
	                            <td>{$vo.tid}</td>
	                            <td><input type='text' name="" value="{$vo.tname}" onblur="doblur(this,{$vo['tid']})"></td>
	                            <td>
	                                <a class="link-del" href="javascript:del({$vo.tid})">删除</a>
	                            </td>
	                        </tr> 
                        </foreach>
                    </table>
                </div>
        </div>
    </div>
<script>
	//失焦事件
function doblur(s,id){
var yh = $.trim($(s).val()); 
 if(confirm("执行后将无法恢复，确定继续吗？温馨提示"))
            {
            $.post('__URL__/Tupdate', {type:id,val:yh}, function(data) {
                alert(data);
            });
        }
}

function del(id) {
    if(confirm("执行后将无法恢复，确定继续吗？温馨提示"))
            {
        $.post('__URL__/Tdelete', {'id':id}, function(data){
           alert(data);
           location.reload([true])  
        });
        exit;
        }
    }
    function add() {
    // if(confirm("执行后将无法恢复，确定继续吗？温馨提示"))
    //         {
        $.post('__URL__/Tdelete', {'id':id}, function(data){
           alert(data);
           location.reload([true])  
        });
        exit;
        // }
    }
</script>
</block>